.class public Les/t8;
.super Ljava/lang/Object;
.source "VideoAds.java"


# instance fields
.field private a:I

.field private b:I

.field private c:Ljava/lang/String;

.field private d:Lcom/esfile/screen/recorder/media/b;

.field private e:J

.field private f:J

.field private g:J

.field private h:J

.field private i:J

.field private j:J

.field private k:Landroid/graphics/Bitmap;

.field private l:Landroid/graphics/RectF;


# direct methods
.method private a(Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;
    .locals 4

    if-eqz p1, :cond_0

    .line 6
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->isMutable()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Les/t8;->k:Landroid/graphics/Bitmap;

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->isRecycled()Z

    move-result v0

    if-nez v0, :cond_0

    .line 7
    new-instance v0, Landroid/graphics/Canvas;

    invoke-direct {v0, p1}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    .line 8
    iget-object v1, p0, Les/t8;->k:Landroid/graphics/Bitmap;

    iget-object v2, p0, Les/t8;->l:Landroid/graphics/RectF;

    const/4 v3, 0x0

    invoke-virtual {v0, v1, v3, v2, v3}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/RectF;Landroid/graphics/Paint;)V

    :cond_0
    return-object p1
.end method

.method private d()V
    .locals 4
    .annotation build Landroidx/annotation/WorkerThread;
    .end annotation

    .line 1
    iget-object v0, p0, Les/t8;->d:Lcom/esfile/screen/recorder/media/b;

    if-nez v0, :cond_0

    .line 2
    new-instance v0, Lcom/esfile/screen/recorder/media/b;

    invoke-direct {v0}, Lcom/esfile/screen/recorder/media/b;-><init>()V

    iput-object v0, p0, Les/t8;->d:Lcom/esfile/screen/recorder/media/b;

    .line 3
    :try_start_0
    iget v1, p0, Les/t8;->a:I

    iget v2, p0, Les/t8;->b:I

    invoke-virtual {v0, v1, v2}, Lcom/esfile/screen/recorder/media/b;->a(II)V

    .line 4
    iget-object v0, p0, Les/t8;->d:Lcom/esfile/screen/recorder/media/b;

    iget-object v1, p0, Les/t8;->c:Ljava/lang/String;

    invoke-virtual {v0, v1}, Lcom/esfile/screen/recorder/media/b;->a(Ljava/lang/String;)V

    .line 5
    iget-object v0, p0, Les/t8;->d:Lcom/esfile/screen/recorder/media/b;

    invoke-virtual {v0}, Lcom/esfile/screen/recorder/media/b;->a()J

    move-result-wide v0

    iput-wide v0, p0, Les/t8;->g:J

    const-string v0, "vdds"

    .line 6
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "grabber ready, duration = "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v2, p0, Les/t8;->g:J

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    :cond_0
    return-void
.end method


# virtual methods
.method public a()Landroid/graphics/Bitmap;
    .locals 4
    .annotation build Landroidx/annotation/WorkerThread;
    .end annotation

    .line 1
    invoke-direct {p0}, Les/t8;->d()V

    .line 2
    iget-wide v0, p0, Les/t8;->f:J

    iget-wide v2, p0, Les/t8;->i:J

    sub-long/2addr v0, v2

    iget-wide v2, p0, Les/t8;->g:J

    invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->min(JJ)J

    move-result-wide v0

    const-wide/16 v2, 0x0

    invoke-static {v2, v3, v0, v1}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v0

    iput-wide v0, p0, Les/t8;->e:J

    .line 3
    iget-object v2, p0, Les/t8;->d:Lcom/esfile/screen/recorder/media/b;

    const/4 v3, 0x1

    invoke-virtual {v2, v0, v1, v3}, Lcom/esfile/screen/recorder/media/b;->a(JZ)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 4
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "grabber a bitmap = "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    const-string v2, ", time stamp = "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v2, p0, Les/t8;->e:J

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v2, ", video stamp = "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v2, p0, Les/t8;->f:J

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    const-string v2, "vdds"

    invoke-static {v2, v1}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 5
    invoke-direct {p0, v0}, Les/t8;->a(Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;

    return-object v0
.end method

.method public a(J)Z
    .locals 12
    .annotation build Landroidx/annotation/WorkerThread;
    .end annotation

    .line 9
    invoke-direct {p0}, Les/t8;->d()V

    .line 10
    iput-wide p1, p0, Les/t8;->f:J

    .line 11
    iget-wide v0, p0, Les/t8;->g:J

    const-wide/16 v2, 0x0

    const/4 v4, 0x1

    cmp-long v5, v0, v2

    if-gtz v5, :cond_0

    return v4

    .line 12
    :cond_0
    iget-wide v5, p0, Les/t8;->h:J

    add-long v7, v0, v5

    cmp-long v9, v7, v2

    if-gtz v9, :cond_1

    return v4

    .line 13
    :cond_1
    iget-wide v7, p0, Les/t8;->j:J

    sub-long v9, p1, v7

    cmp-long v11, v9, v2

    if-gez v11, :cond_2

    return v4

    :cond_2
    sub-long/2addr p1, v7

    add-long/2addr v0, v5

    .line 14
    rem-long/2addr p1, v0

    .line 15
    invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;

    move-result-object v0

    const/4 v1, 0x5

    new-array v1, v1, [Ljava/lang/Object;

    iget-wide v5, p0, Les/t8;->f:J

    .line 16
    invoke-static {v5, v6}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v5

    const/4 v6, 0x0

    aput-object v5, v1, v6

    iget-wide v7, p0, Les/t8;->j:J

    invoke-static {v7, v8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v5

    aput-object v5, v1, v4

    const/4 v5, 0x2

    iget-wide v7, p0, Les/t8;->g:J

    invoke-static {v7, v8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v7

    aput-object v7, v1, v5

    const/4 v5, 0x3

    iget-wide v7, p0, Les/t8;->h:J

    invoke-static {v7, v8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v7

    aput-object v7, v1, v5

    const/4 v5, 0x4

    invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v7

    aput-object v7, v1, v5

    const-string v5, "video time = %d, video start = %d, ad duration = %d, ad interval = %d, left = %d"

    .line 17
    invoke-static {v0, v5, v1}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    const-string v1, "vdds"

    invoke-static {v1, v0}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 18
    iget-wide v0, p0, Les/t8;->g:J

    cmp-long v5, p1, v0

    if-gtz v5, :cond_5

    .line 19
    iget-wide v0, p0, Les/t8;->i:J

    cmp-long v4, v0, v2

    if-gez v4, :cond_3

    .line 20
    iget-wide v0, p0, Les/t8;->f:J

    iput-wide v0, p0, Les/t8;->i:J

    .line 21
    :cond_3
    iget-wide v0, p0, Les/t8;->f:J

    iget-wide v2, p0, Les/t8;->i:J

    sub-long v2, v0, v2

    iget-wide v4, p0, Les/t8;->g:J

    cmp-long v7, v2, v4

    if-lez v7, :cond_4

    sub-long/2addr v0, p1

    .line 22
    iput-wide v0, p0, Les/t8;->i:J

    :cond_4
    return v6

    :cond_5
    const-wide/16 p1, -0x1

    .line 23
    iput-wide p1, p0, Les/t8;->i:J

    return v4
.end method

.method public b()J
    .locals 3

    .line 1
    iget-object v0, p0, Les/t8;->c:Ljava/lang/String;

    invoke-static {v0}, Lcom/esfile/screen/recorder/media/util/u;->a(Ljava/lang/String;)[Landroid/media/MediaFormat;

    move-result-object v0

    const/4 v1, 0x1

    .line 2
    aget-object v0, v0, v1

    const/4 v1, -0x1

    if-eqz v0, :cond_0

    const-string v2, "frame-rate"

    .line 3
    invoke-static {v0, v2, v1}, Lcom/esfile/screen/recorder/media/util/s;->a(Landroid/media/MediaFormat;Ljava/lang/String;I)I

    move-result v0

    if-lez v0, :cond_0

    const v1, 0xf4240

    .line 4
    div-int/2addr v1, v0

    :cond_0
    int-to-long v0, v1

    return-wide v0
.end method

.method public c()V
    .locals 1

    .line 1
    iget-object v0, p0, Les/t8;->d:Lcom/esfile/screen/recorder/media/b;

    if-eqz v0, :cond_0

    .line 2
    invoke-virtual {v0}, Lcom/esfile/screen/recorder/media/b;->c()V

    const/4 v0, 0x0

    .line 3
    iput-object v0, p0, Les/t8;->d:Lcom/esfile/screen/recorder/media/b;

    .line 4
    :cond_0
    iget-object v0, p0, Les/t8;->k:Landroid/graphics/Bitmap;

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    return-void
.end method
